package com.yowasa.xiuxian.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum StageEnum {
    FAN_REN(1, "凡人", 10,0,1),
    LIAN_QI(2, "初薪之乌", 100,50,2),
    ZHU_JI(3, "始明之青", 200,80,3),
    JIE_DAN(4, "了彻之白", 500,100,4),
    JIN_DAN(5, "如曜之金", 1000,120,5),
    YUAN_YING(6, "流幻之铂", 2000,150,7),
    HUA_SHEN(7, "璀璨之钻", 3000,200,9),
    DU_JIE(8, "深邃之星", 4000,500,12),
    DENG_XIAN(9, "尘世执政官", 100,0,15),
    ;
    //等级
    private int level;
    //名称
    private String name;
    //灵气需求
    private int need;

    //增加寿元
    private int addLife;
    //获取能力倍率
    private int rate;

    public static StageEnum getById(int id) {
        return Arrays.stream(StageEnum.values()).filter(e -> e.getLevel() == id).findFirst().orElse(null);
    }

    public static StageEnum getByName(String name) {
        return Arrays.stream(StageEnum.values()).filter(e -> e.getName().equals(name)).findFirst().orElse(null);
    }
}
